package com.server;

import static org.junit.Assert.*;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import javax.xml.transform.TransformerException;

import org.junit.Test;
import org.xml.sax.SAXException;

public class AndroidServerTest {

	
	@Test
	public void testAddFriendNew () throws SAXException, IOException, ParserConfigurationException, TransformerException
	{
		AndroidServer server = new AndroidServer("varun");
		server.AddFriend("Varun", "Shubham");
		server.AddFriend("Varun", "Amit");
		server.AddFriend("Varun", "Sumit");
		server.AddFriend("Varun", "Shubham");
	}

	@Test
	public void testRegisterUser() throws FileNotFoundException, XMLStreamException
	{
		AndroidServer server = new AndroidServer("varun");
		int returnValue = server.RegisterUser("Varun");
		System.out.println("Return Value: "+returnValue);
	}
	
	@Test
	public void testGetFriendList() throws ParserConfigurationException, SAXException, IOException
	{
		AndroidServer server = new AndroidServer("varun");
		HashSet<String> friendList = server.GetFriendList("Varun");
		Iterator<String> iter = friendList.iterator();
		while(iter.hasNext())
			System.out.println(iter.next());

	}
}
